import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/smsdetail',
    name: 'SmsDetail',
    component: () => import(/* webpackChunkName: "about" */ '../views/SmsDetail.vue')
  },
  {
    path: '/datadetail',
    name: 'DataDetail',
    component: () => import(/* webpackChunkName: "about" */ '../views/DataDetail.vue')
  },
  {
    path: '/voicedetail',
    name: 'VoiceDetail',
    component: () => import(/* webpackChunkName: "about" */ '../views/VoiceDetail.vue')
  },
]

const router = new VueRouter({
  routes,
  scrollBehavior() {
    // 始终滚动到顶部
    return { y: 0 }
  },
})

export default router
